<%@ page import="com.ticketbooking.entity.UserEntity" %><%--
  Created by IntelliJ IDEA.
  User: linzhi
  Date: 2017/8/23
  Time: 16:37
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/WEB-INF/common/top.jsp"%>
<html>
<head>
    <title>Title</title>
</head>
<%
//    UserEntity user = (UserEntity)request.getSession().getAttribute("user");
    String name = (String)session.getAttribute("managername");
    String permission = (String)session.getAttribute("permission");
    Boolean flag = false;
    if(name!=null){
        flag = true;
    }
    pageContext.setAttribute("flag", flag);
%>
<script src="${path}/tools/jquery-1.8.2.min.js"></script>
<script>
    var path = "${path}";
    var name = "${managername}";
    var name2 = "<%=name %>";
    var permission = "${permission}";
    $(document).ready(function () {
        $("#login").click(function () {
            window.location.href =  path+"/security/login.action";
        });
        $("#register").click(function () {
            window.location.href =  path+"/security/register.action";
        });
        console.log(name);
    });
</script>
<body>
    <%--<c:if test="${username eq 'manager' or username eq 'st_cjgly'}">--%>
        <%--<a class="portalLi" href="javascript:">[后台管理]</a>--%>
    <%--</c:if>--%>
    <c:if test="${!flag}">
        <button id="login">点击登录</button>
        <%--<button id="register">注册</button>--%>
    </c:if>
    <c:if test="${flag}">
        <div>已登录，登录用户为<%=name %></div>
        <div>用户权限级别是:<%=permission %></div>
    </c:if>
</body>
</html>
